<!DOCTYPE html>
<html>
<head>
  <%= render partial: 'layouts/head', locals: {title: (t 'web.org') + (t 'web.manage_system')} %>
  <%= javascript_include_tag '/assets/My97DatePicker/WdatePicker.js' %>
</head>
<body>
    <%= render partial: 'layouts/nav', locals: {title: (t 'web.org') + (t 'web.manage_system')} %>

    <div class="main-container" id="main-container">
      <div class="main-container-inner">
        <a class="menu-toggler" id="menu-toggler" href="#">
          <span class="menu-text"></span>
        </a>
        <div class="sidebar" id="sidebar">
          <script type="text/javascript">
              try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
          </script>
          <ul class="nav nav-list">

            <% if can? :manage, User %>
                <li data-model="user_list">
                  <%= link_to admin_users_path do %>
                      <i class="icon-user"></i>
                      <span class="menu-text"> <%= t 'activerecord.attributes.user.admin_title' %> </span>
                  <% end %>
                </li>
            <% end %>
            <% if can? :manage, Organization %>
                <li data-model="organization_list">
                  <%= link_to admin_organizations_path do %>
                      <i class="icon-group"></i>
                      <span class="menu-text"> <%= t 'activerecord.attributes.organization.admin_title' %> </span>
                  <% end %>
                </li>
            <% end %>
            <% if can? :manage, CodeTable %>
                <li data-model="code_table_list">
                  <%= link_to admin_code_tables_path do %>
                      <i class="icon-book"></i>
                      <span class="menu-text"> <%= t 'activerecord.attributes.code_table.admin_title' %> </span>
                  <% end %>
                </li>
            <% end %>
            <% if can? :manage, Role %>
                <li data-model="role_list">
                  <%= link_to admin_roles_path do %>
                      <i class="icon-key"></i>
                      <span class="menu-text"> <%= t 'activerecord.attributes.role.admin_title' %> </span>
                  <% end %>
                </li>
            <% end %>
            <% if can? :manage, Permission %>
                <li data-model="permission_list">
                  <%= link_to admin_permissions_path do %>
                      <i class="icon-lock"></i>
                      <span class="menu-text"> <%= t 'activerecord.attributes.permission.admin_title' %> </span>
                  <% end %>
                </li>
            <% end %>
            <% if can? :manage, Permission %>
                <li data-model="attachment_list">
                  <%= link_to admin_attachments_path do %>
                      <i class="icon-cloud-upload"></i>
                      <span class="menu-text"> <%= t 'activerecord.attributes.attachment.admin_title' %> </span>
                  <% end %>
                </li>
            <% end %>

            <% if can? :manage, Article %>
                <li data-model="article_list">
                  <%= link_to admin_articles_path do %>
                      <i class="icon-book"></i>
                      <span class="menu-text"> <%= t 'activerecord.attributes.article.admin_title' %> </span>
                  <% end %>
                </li>
            <% end %>

            <% if can? :manage, Comment %>
                <li data-model="comment_list">
                  <%= link_to admin_comments_path do %>
                      <i class="icon-comment"></i>
                      <span class="menu-text"> <%= t 'activerecord.attributes.comment.admin_title' %> </span>
                  <% end %>
                </li>
            <% end %>

          </ul>
          <div class="sidebar-collapse" id="sidebar-collapse">
            <i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
          </div>

          <script type="text/javascript">
              try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
          </script>
        </div>
        <div class="main-content" data-pjax-container>
          <%= render template: 'layouts/admin/pjax' %>
        </div>
        <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
          <i class="icon-double-angle-up icon-only bigger-110"></i>
        </a>
      </div><!-- /.main-container-inner -->
    </div>
    <script>
        $(function() {
//            $(document).pjax('a.pjax:not([data-remote]):not([data-behavior]):not([data-skip-pjax])', '[data-pjax-container]');
        });
    </script>
</body>
</html>
